{extend name='admin@main'}

{block name="button"}

<!--{if auth("add")}-->
<!--<button data-modal='{:url("add")}' data-title="添加来访记录信息" class='layui-btn layui-btn-sm layui-btn-primary'>添加来访记录信息</button>-->
<!--{/if}-->

<!--{if auth("remove")}-->
<!--<button data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" data-confirm="确定要删除这些信息吗？" action="{:url('department/remove')}" class='layui-btn layui-btn-sm layui-btn-primary'>删除访客记录信息</button>-->
<!--{/if}-->

{/block}

{block name="content"}
<div class="think-box-shadow">
    {include file='record/index_search'}
    <table class="layui-table" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='list-table-sort-td'>
                <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
            </th>
            <th class='text-left nowrap'>访客姓名</th>
            {if $userinfo['db1']['authorize'] == 1 || $userinfo['db1']['authorize'] == 8}
            <th class='text-left nowrap'>到访公司</th>
            {/if}
            <th class='text-left nowrap'>到访时间</th>
			 <th class='text-left nowrap'>离开时间</th>
			<th class='text-left nowrap'>拜访部门</th>
			<th class='text-left nowrap'>接见员工</th>
            <th class='text-left nowrap'>到访状态</th>
<!--             <th class='text-left nowrap'>添加时间</th> -->
            <th class='text-left nowrap'>操作选项</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
            
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
             <td class='text-left nowrap'>{$vo.id}</td>
            <td class='text-left nowrap'>{$vo.vister_name|default='-'}</td>
            {if $userinfo['db1']['authorize'] == 1 || $userinfo['db1']['authorize'] == 8}
            <td class='text-left nowrap'>{$vo.app_company_name|default='-'}</td>
            {/if}
            <td class='text-left nowrap'> {$vo.vister_arrivetime|format_datetime}</td>
			<td class='text-left nowrap'> {$vo.vister_leavetime|format_datetime}</td>
			<td class='text-left nowrap'>{$vo.address|default='-'}</td>
			<td class='text-left nowrap'>{$vo.app_user_name|default='-'}</td>
            <td class='text-left nowrap'>

                {if $vo.status==0}
                    {switch name="vo.arrive_status" }
  
                        {case value='1'}<a class="layui-btn layui-btn-radius layui-btn-sm layui-btn-green">到达</a>{/case}
                        {case value='2'}<a class="layui-btn layui-btn-radius layui-btn-sm layui-btn-normal">保安放行</a>{/case}
                        {case value='3'}<a class="layui-btn layui-btn-radius layui-btn-sm layui-btn-green">到达指定位置</a>{/case}
                        {case value='4'}<a class="layui-btn layui-btn-radius layui-btn-sm layui-btn-normal">完成-已离开</a>{/case}
                        {case value='5'}<a class="layui-btn layui-btn-radius layui-btn-sm layui-btn-warm">保安拒绝</a>{/case}
                        {case value='6'}<a class="layui-btn layui-btn-radius layui-btn-sm layui-btn-normal">离开部门</a>{/case}
                        {default  /}未到访
                    {/switch}
                    {elseif $vo.status==1}
                        <a class="layui-btn layui-btn-radius layui-btn-sm layui-btn-normal">完成-离开</a>
                    {elseif $vo.status==2}
                        <a class="layui-btn layui-btn-radius layui-btn-sm layui-btn-warm">已逾期</a>
                    {elseif $vo.status==3}
                        <a class="layui-btn layui-btn-radius layui-btn-sm layui-btn-normal">逾期完成-离开</a>
                    {else}
                {/if}


            </td>

            <td class='text-left nowrap'>
                {if auth("details")}
                <a data-dbclick class="layui-btn layui-btn-sm" data-title="详 情" data-modal='{:url("details")}?id={$vo.id}'>详 情</a>
                {/if}


        </td>
<!--             <td class='text-left nowrap'>

                {if auth("edit")}
                <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑员工信息" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
                {/if}

               

                {if auth("remove")}
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该访客吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}" action="{:url('user/remove')}">删 除</a>
                {/if}

            </td> -->
        </tr>
        {/foreach}
         
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>

{/block}
